<!--
* description: 选择服务
-->
<template>
  <section class="carTypeConfig">
    <el-dialog
      v-dialogDrag
      title="服务选择"
      :visible.sync="curPopupsVisible"
      width="1000px"
      center
      @close="sendCode"
      :close-on-click-modal="false"
      :append-to-body="true"
    >
      <dialogHeader slot="title" :title="'服务选择'" :styleType="$store.state.app.dialogType"></dialogHeader>
      <one-table-template
        ref="multipleTable"
        :isSetDefaultBrand="false"
        :dynamicButtons="tableButtons"
        :dynamicComponents="tableComponents"
        :dynamicApiConfig="apiConfig"
        :dynamicTableCols="tableCols"
        :dynamicFormFields="formField"
        :dynamicIsShowSelect="isMul"
      />
    </el-dialog>
  </section>
</template>
<script>
import { oneTableWithViewTemplateMixins } from "@/components/mixins/oneTableWithViewTemplateMixins";
import { valueObjectMixins } from "@/components/mixins/valueObjectMixins";
import { crmApis } from "@/api/apiList/crm";
import OneTableTemplate from "@/components/crm/commonComponents/crmPopupsOneTable";
export default {
  // 组件混入对象：{data[listQuery] methods[queryTable]}
  mixins: [oneTableWithViewTemplateMixins, valueObjectMixins],
  components: {
    OneTableTemplate,
    dialogHeader: () => import("@/components/dialogHeader") //弹窗标题
  },
  data() {
    return {
      // 网格查询API配置对象
      apiConfig: crmApis.mdmVeCarSeriesQueryListForPage,
      // 动态组件-按钮
      tableButtons: [
        {
          compKey: "btnKey1",
          type: "primary",
          size: "small",
          clickEvent: () => this.queryTable(1),
          text: "查询",
          position: "top"
        },
        {
          compKey: "btnKey2",
          type: "primary",
          size: "small",
          clickEvent: () => this.sendCode("carSeriesCode", "carSeriesCn"),
          text: "确认",
          position: "bottom"
        },
        {
          compKey: "btnKey3",
          type: "",
          size: "small",
          clickEvent: () => this.reset(),
          text: "重置",
          position: "top"
        }
      ],
      // 动态组件-查询条件
      tableComponents: [
        // 显示组件
        {
          compKey: "compKey1",
          labelName: "服务名称",
          codeField: "carSeriesCn",
          component: () => import("@/components/org/commonInput"),
          type: "inputText",
          isMust: true,
          disabled: false
        }
      ],
      // 动态生成网格列
      tableCols: [
        // {
        //   prop: "controlBtn",
        //   label: "操作",
        //   width: 60,
        //   align: "center",
        //   isComponent: true,
        //   fixed: true,
        //   comps: [
        //     {
        //       compKey: "propKey1",
        //       codeField: "userName",
        //       labelName: "选择",
        //       align: "center",
        //       isShowLabel: true,
        //       isShow: true,
        //       clickEvent: index => this.sendCode(this.codeField,"carSeriesId"),
        //       component: () => import("@/components/org/linkButton")
        //     },
        //   ]
        // },
        {
          prop: "",
          label: "服务名称",
          width: null,
          align: "center"
        },
        {
          prop: "carSeriesCode",
          label: "服务类型",
          width: null,
          align: "center"
        },
        {
          prop: "carSeriesId",
          label: "所需积分",
          width: 150,
          align: "center"
        },
        {
          prop: "carSeriesId",
          label: "价格",
          width: 150,
          align: "center"
        },
        {
          prop: "carSeriesId",
          label: "服务有效时长",
          width: 150,
          align: "center"
        }
      ],
      //表单查询数据（查询条件）
      formField: {
        carBrandCode: "",
        carSeriesCn: ""
      }
    };
  }
};
</script>
